home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / games / nerak2.zip / INITGAME.SCR < prev    next >
Text File  |  1995-10-02  |  5KB  |  150 lines

  1. !
  2. ! FILE : initgame.scr
  3. !
  4. ! DESCRIPTION
  5. !   Example introduction script.  This script is executed when the game
  6. !   is first started.  A party of a single player has been created with
  7. !   initial values set to those found in statistics record # 0, with
  8. !   the following additions:
  9. !
  10. !     group.gold        = 1000;   (1000 silver or 100 gold)
  11. !     group.food        =   25;
  12. !     player.name       = "John Doe";
  13. !     player.type       = 0; ! 'REGULAR' in the standard DCCTOKEN.DAT file
  14. !     player.class      = 0; ! 'HUMAN'   in the standard DCCTOKEN.DAT file
  15. !     player.level      = 1;
  16. !     player.experience = 1;
  17. !     player.energy     = 1000;
  18. !
  19. ! You may change any group and/or player attributes in this script, and
  20. ! may call the 'edit_player()' function to invoke the character creation
  21. ! screen.  This function accepts a the following parameters:
  22. !
  23. !   edit_player( which,                 (1 to 6, required)
  24. !                points to distribute   (0 to 40, default 25), 
  25. !                min attribute value    (0 to 255, default 9),
  26. !                max attribute value    (0 to 255, default 20),
  27. !                allow-name-edit        (1 = yes, 0 = no, default 1),
  28. !                allow-class-edit       (1 = yes, 0 = no, default 1),
  29. !                allow-block-edit       (1 = yes, 0 = no, default 1),
  30. !                allow-attribute-0-edit (1 = yes, 0 = no, default 1),
  31. !                allow-attribute-1-edit (1 = yes, 0 = no, default 1),
  32. !                ... );
  33. ! Only the first parameter is required, all others may be omitted.
  34. !
  35. ! Note that the automatic adjustments for 'class' are now part of this
  36. ! script, instead of part of the 'edit_player' function.  They occur
  37. ! AFTER character creation.  A small price to pay for the flexibility
  38. ! provided by 'edit_player'.
  39. !
  40. ! If you don't wan't to use the character creation screen, you may set
  41. ! the attributes in many different ways, for example:
  42. !
  43. ! You might get the name this way:
  44. !   :XLOOP
  45. !     write( "What is your name: " );
  46. !     L0 = getstr( "Hey You" );
  47. !     if S0 = "" goto XLOOP;  ! You HAVE to enter a name
  48. !     player.name = S0;
  49. !
  50. ! You might set the class using a menu, as follows:
  51. !   L0 = select( "Wizard", "Elf", "Dwarf" );
  52. !   on L0 goto XWIZ, XELF, XDWARF;
  53. !   :XWIZ   player.class = WIZARD; goto XNEXT;
  54. !   :XELF   player.class = ELF;    goto XNEXT;
  55. !   :XDWARF player.class = DWARF;  goto XNEXT;
  56. !   :XNEXT
  57. !
  58. ! Or directly...
  59. !   player.class = ELF;
  60. !
  61. ! The standard attributes can be set directly in statistics record # 0
  62. ! (using the DCWORLD program) or in this script by direct assignment.
  63. !
  64. ! The usual values in the standard statistics record # 0 for the attribute
  65. ! fields is a 9.
  66. !
  67.  
  68. !------------------------------------------------------------------------!
  69.  
  70. ! Record how much memory is left after starting the game driver just
  71. ! in case I run into memory problems later and want to know this info.
  72.  
  73. system( "mem /C >freemem.xxx" );
  74. if failure then
  75.   writeln( "Couldn't run FREEMEM.XXX. Press <space>" );
  76.   pause;
  77. endif;
  78. ! Do the initial sequence of music, graphics, etc
  79. !
  80. music   ( "intro1.cmf" );  ! Play background music
  81. viewpcx ( "intro1.pcx" );  ! Show a nice picture
  82. wait    ( 120 );
  83. music   ( "intro2.cmf" );  ! Play background music
  84. readtext( "intro1.txt" );  ! Read some text.
  85.  
  86. !
  87. ! Now, create the player's character by using 'edit_player'
  88. !
  89.   edit_player( 1 );
  90.   on player.class goto XHUMAN,XELF,XDWARF,XWIZARD,XARCHER,XFIGHTER;
  91.  
  92.   ! any other, drop into 'XHUMAN'
  93.  
  94. :XHUMAN
  95.   goto DONE; ! No adjustments for 'Humans'
  96.  
  97. :XELF
  98.   inc( player.mspd );
  99.   dec( player.mstr );
  100.   inc( player.mpwr );
  101.   goto DONE;
  102.  
  103. :XDWARF
  104.   inc( player.mstr );
  105.   inc( player.mdex );
  106.   dec( player.mspd, 2 );
  107.   inc( player.mhp,  2 );
  108.   goto DONE;
  109.  
  110. :XWIZARD
  111.   inc( player.miq,  2 );
  112.   inc( player.mpwr, 3 );
  113.   dec( player.mstr, 3 );
  114.   dec( player.mhp,  2 );
  115.   goto DONE;
  116.  
  117. :XARCHER
  118.   inc( player.maim, 2 );
  119.   inc( player.mspd, 2 );
  120.   dec( player.mstr, 2 );
  121.   goto DONE;
  122.  
  123. :XFIGHTER
  124.   inc( player.mstr, 4 );
  125.   inc( player.mhp,  2 );
  126.   inc( player.miq,  4 );
  127.   goto DONE;
  128.  
  129. :DONE
  130.  
  131. ! Here, you may transfer the party to any location at which you wish
  132. ! the game to start. For example, to start in world 3, 2 squares 
  133. ! south (down) and 5 right from the location of door 7, use:
  134. !
  135. !   teleport( 3, world.doorx(7) + 5, world.doory(7) - 2 );
  136. !
  137. ! You may also set the group's X and Y location directly if you wish
  138. ! to alter the location within world zero.
  139. !
  140. ! The default start location is right over the location of door 0 in
  141. ! world 0.
  142. !
  143.  
  144.   dec( group.y ); ! Start example game 1 square above door 0 in world 0
  145.   music( stop );
  146.   STOP;  ! Use CONTINUE if you want the driver to invoke edit_player()
  147.  
  148.                                                                           
  149.